﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/MasterPage/AdminMasterPage.master" AutoEventWireup="true" CodeFile="FinMov001g.aspx.cs" Inherits="Admin_FinMov_FinMov001g" %>

<asp:Content ID="Content1" ContentPlaceHolderID="phScript" runat="Server">
    <script type="text/javascript" src="/Scripts/Controls/DatePicker/WdatePicker.js"></script>
    <script type="text/javascript">
        function PrintLabel() {
            var checkList = $(".pagnationtable input:checked");
            if (checkList.length > 8) {
                alert('选择的记录数不能超过8条。(当前选择：' + checkList.length + '条)');
                return;
            }
            if (checkList.length > 0) {
                var ids = "";
                checkList.each(function () {
                    ids += $(this).parent().attr("data-boxid") + ",";
                });

                OpenWindow('标签打印', 'P', '/Admin/SAPFin/SAPFin002P.aspx?type=P&boxids=' + ids, 1200, 740)
            }
            else {
                alert("请选择您要打印的凭证盒标签!");
            }
        }

        function giveLocation() {
            var checkList = $(".pagnationtable input:checked");

            if (checkList.length > 0) {
                var ids = "";
                checkList.each(function () {
                    ids += $(this).parent().attr("data-boxid") + ",";
                });

                OpenWindow('分配仓库号', 'P', '/Admin/SAPFin/SAPFin002f.aspx?boxids=' + ids, 800, 740)
            }
            else {
                alert("请选择您要分配仓库号的凭证盒标签!");
            }
        }

        function Location(ids) {
            OpenWindow('分配仓库号', 'P', '/Admin/SAPFin/SAPFin002f.aspx?boxids=' + ids, 800, 740);
            return false;
        }

        $(function () {
            $("span").each(function () {
                if ($(this).attr("data-recount") == '0') {
                    $(this).find("input").hide();
                }
            });
        });

        function searchDiv() {
            $("#tbSearch").toggle("fast");
            if ($("#divButton").hasClass("open")) {
                $("#divButton").removeClass("open");
                $("#divButton").addClass("close")
            }
            else {
                $("#divButton").removeClass("close");
                $("#divButton").addClass("open")
            }

        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <div style="width: 100%; min-width: 700px">
        <div style="padding-right: 12px; display: block;">
            <div class="searchBox">
                <div class="sb1">搜索条件<asp:HiddenField ID="hid_shipID" runat="server" /></div>
                <table width="100%" cellspacing="2" cellpadding="2" id="tbSearch">
                    <tr>
                        <td width="100px">创建日期:
                        </td>
                        <td colspan="3">
                            <span style="color: #000;">
                                <input class="Wdate textBox" style="width: 180px;" runat="server" readonly="readonly"
                                    type="text" id="txtStartDate" clientidmode="Static" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'txtEndate\')||$dp.$DV(\'9998-12-31\')}'})" />&nbsp;&nbsp;至&nbsp;&nbsp;
                    <input class="Wdate textBox" runat="server" readonly="readonly" type="text" id="txtEndate"
                        clientidmode="Static" style="width: 180px;" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'txtStartDate\');}',maxDate:'9998-12-31'})" />
                            </span>

                        </td>
                    </tr>
                    <tr>
                        <td>文档日期:
                        </td>
                        <td colspan="3">
                            <yncWebDDL:DrpYear ID="drpYearStart" runat="server">
                            </yncWebDDL:DrpYear>
                            <yncWebDDL:DrpMonth ID="drpMonthStart" runat="server">
                            </yncWebDDL:DrpMonth>
                            -
                            <yncWebDDL:DrpYear ID="drpYearEnd" runat="server">
                            </yncWebDDL:DrpYear>
                            <yncWebDDL:DrpMonth ID="drpMonthEnd" runat="server">
                            </yncWebDDL:DrpMonth>
                        </td>
                    </tr>
                    <tr>
                        <td>文档盒条形码:</td>
                        <td>
                            <yncWeb:yncTextBox ID="txtBoxNo" runat="server"></yncWeb:yncTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>文档描述:</td>
                        <td>
                            <yncWebDDL:DrpCodeTable ID="drpDocType" runat="server" Category="CTE006" ShowSelectedItem="true">
                            </yncWebDDL:DrpCodeTable>
                        </td>
                    </tr>
                    <tr>
                        <td>公司名称:
                        </td>
                        <td>
                            <yncWebDDL:DrpCompany ID="drpCompany" runat="server" ShowSelectedItem="true">
                            </yncWebDDL:DrpCompany>
                        </td>
                    </tr>
                    <tr>
                        <td>职能部门:
                        </td>
                        <td>
                            <yncWebDDL:DrpCodeTable ID="drpFunctionDept" runat="server" Category="CTE001" ShowSelectedItem="true">
                            </yncWebDDL:DrpCodeTable>
                        </td>
                    </tr>

                    <tr>
                        <td>存储地点:
                        </td>
                        <td>
                            <yncWebDDL:DrpThirdUnit ID="drpLocation" runat="server" ShowSelectedItem="true" AutoPostBack="true" OnSelectedIndexChanged="drpLocation_OnSelectedIndexChanged">
                            </yncWebDDL:DrpThirdUnit>
                            <yncWebDDL:DropDownListBase ID="drpCabin" runat="server" AutoPostBack="true" OnSelectedIndexChanged="drpCabin_OnSelectedIndexChanged"></yncWebDDL:DropDownListBase>
                            <yncWebDDL:DropDownListBase ID="drpNumber" runat="server"></yncWebDDL:DropDownListBase>
                        </td>
                    </tr>
                    <tr>
                        <td>创建人:</td>
                        <td>
                            <yncWebDDL:DrpUsers ID="drpCreator" runat="server" ShowSelectedItem="true" /></td>
                    </tr>
                    <tr>
                        <td colspan="2"><span style="margin-left: 8px">
                            <asp:Button ID="btnSearch" runat="server" Text="搜索" OnClick="btnSearch_Click" /></span></td>
                    </tr>
                </table>
            </div>
        </div>
        
            <table class="menu">
                <tr>
                    <td class="td">
                        <asp:LinkButton CssClass="add" id="btnSave" runat="server" Text="添加" OnClick="btnSave_Click"></asp:LinkButton>
                        <asp:LinkButton CssClass="back" id="btnReturn" runat="server" Text="返回" OnClick="btnRetrun_Click"></asp:LinkButton>
                    </td>
                </tr>
            </table>
        <yncWeb:PagnationGrid PageSize="30" IsPagination="false" ID="pageGrid" runat="server" OnOnPageIndexChange="PageChanged">
            <HeaderTemplate>
                <table width="100%" cellspacing="0" cellpadding="0" class="pagnationtable" align="left">
                    <thead>
                        <tr>
                            <th width="60px">序号
                            </th>

                            <th width="120px">凭证日期
                            </th>
                            <th width="110px">凭证盒条形码
                            </th>
                            <th>文档描述
                            </th>
                            <th>存储地点
                            </th>
                            <th>公司名称
                            </th>
                            <th>公司编号
                            </th>
                            <th>职能部门</th>
                            <th width="100px">凭证数量
                            </th>
                            <th width="80px">存储状态
                            </th>
                            <th width="180px">创建人/最后更新人
                            </th>
                            <th width="280px">创建时间/最后更新时间
                            </th>

                        </tr>
                    </thead>
                    <tbody>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td style="text-align: right; padding-right: 5px;">
                        <asp:CheckBox ID="chk_sel" data-recount="<%# GetDocumentCount(Eval(FinReceiptMetadata.ColumnNames.BoxID)) %>" class="sel_class" runat="server" data-boxid="<%# Eval(FinReceiptMetadata.ColumnNames.BoxID) %>" />
                        <asp:Label ID="lbBoxID" runat="server" Visible="false" Text="<%# Eval(FinReceiptMetadata.ColumnNames.BoxID) %>"></asp:Label>
                        <%# Container.ItemIndex +1+ (this.pageGrid.CurrentPage-1)*pageGrid.PageSize %>
                    </td>
                    <td>
                        <%# Eval("BoxYear")%>-<%#Eval("BoxMonth")%><%#string.IsNullOrEmpty(Eval("BoxMonthEnd").ToString())?"":"~"+Eval("BoxYear").ToString()+"-"+Eval("BoxMonthEnd").ToString()%>
                    </td>
                    <td>
                        <%# Eval("BoxNo")%>
                    </td>
                    <td>
                        <%# Eval("DocumentTypeName")%>
                    </td>
                    <td>
                        <%# Eval("LocationName")%>
                    </td>
                    <td>
                        <%# Eval("CompanyName")%>
                    </td>
                    <td>
                        <%# Eval("CompanyCode")%>
                    </td>
                    <td>
                        <%# Eval("FunctionDeptName")%>
                    </td>
                    <td>
                        <%# GetDocumentCount(Eval(FinReceiptMetadata.ColumnNames.BoxID))%>
                    </td>
                    <%-- <td>
                        <%# GetOpenClose( Eval(VBoxReceiptsMetadata.ColumnNames.IsOpen))%>
                    </td>--%>
                    <td>
                        <%# Eval("StorageStatusName")%>
                    </td>
                    <td>
                        <%# Eval("CreatedBy")%> / <%# Eval("UpdatedBy")%>
                    </td>
                    <td>
                        <%# Eval(FinReceiptMetadata.ColumnNames.CreatedDttm).FormatDate(ConstantValue.DateTimeFormat)%>  / <%# Eval(FinReceiptMetadata.ColumnNames.UpdatedDttm).FormatDate(ConstantValue.DateTimeFormat)%>
                    </td>

                </tr>
            </ItemTemplate>
            <FooterTemplate>
                </tbody> </table>
            </FooterTemplate>
        </yncWeb:PagnationGrid>

        <div>
              <asp:Label ID="lbMessage" runat="server" ForeColor="Red" Text="&nbsp;" Font-Bold="true" />
        </div>
        
    </div>
    <script type="text/javascript" src="<%=ResolveUrl("~/Scripts/Controls/chosen.jquery.min.js")%>"></script>
    <script type="text/javascript">
        $(function () {
            $("#<%=drpDocType.ClientID %>").css('width', '212px').chosen({
                max_selected_options: 1,
                no_results_text: "No Datas",
                search_contains: true,
                allow_single_deselect: false
            });
        });
    </script>

</asp:Content>

